function  rem(){
    document.documentElement.style.fontSize=document.documentElement.clientWidth/4.8+'px';
}
rem()
window.onresize=rem


$(function(){
    new IScroll('#box')


    $.ajax({
        type:'get',
        url:'json/index.json',
        success:function(res){
            var arr1=res.banner
            var sban=''
            for(var i in arr1){
                sban+=`
                    <section class="swiper-slide">
                        <img src="${arr1[i].src}" alt="">
                    </section>
                `,
                $('#banner>section').html(sban)
                new Swiper('#banner',{
                    loop:true,
                })
            }

            var arr2=res.nav
            var snav=''
            for(var i in arr2){
                snav+=`
                    <li>
                        <img src="${arr2[i].src}" alt="">
                    </li>
                `,
                $('.nav>ul').html(snav)
            }


            var arr3=res.list
            var slist1=''
            for(var i in arr3){
                slist1+=`
                    <li>
                        <img src="${arr3[i].src}" alt="">
                        <p>${arr3[i].text}</p>
                    </li>
                `,
                $('.list>ul').html(slist1)
            }


            var arr4=res.list2
            var slist2=''
            for(var i in arr4){
                slist2+=`
                    <li><img src="${arr4[i].src}" alt=""></li>
                `,
                $('.list2>ul').html(slist2)
            }
        }
    })
})
